$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'spiceinit'

module LCD
  modspice :core_image => "Hardware Accelerated", :main_display => true, 
  :mirror => "off", :online => true

  class Display
    claspice :resolution => "1440x960", :colors => "Millions", :brightness => 50, 
    :auto_adjust => true, :show_in_menu => true, :refresh_rate => "n/a"
  end
end

p LCD.core_image
# => "Hardware Accelerated"
p LCD.main_display
# => true
p LCD.mirror
# => "off"
p LCD.online
# => true
p LCD.class_variables
# => ["@@mirror", "@@online", "@@main_display", "@@core_image"]
p LCD::Display.resolution
# => "1440x960"
p LCD::Display.colors
# => "Millions"
p LCD::Display.brightness
# => 50
p LCD::Display.auto_adjust
# => true
p LCD::Display.show_in_menu
# => true
p LCD::Display.refresh_rate
# => "n/a"
p LCD::Display.class_variables
# => ["@@brightness", "@@refresh_rate", "@@show_in_menu", "@@colors", "@@auto_adjust", "@@resolution"]

module LCD
  modspice :core_image => "Hardware Accelerated", :main_display => true, 
  :mirror => "off", :online => true, :track_spices => true

  class Display
    claspice :resolution => "1440x960", :colors => "Millions", :brightness => 50,
    :auto_adjust => true, :show_in_menu => true, :refresh_rate => "n/a",
    :track_spices => true
  end
end

p LCD.spices_added
# => ["online=", "online", "core_image=", "core_image", "main_display=", "main_display", "mirror=", "mirror"]
p LCD::Display.spices_added
# => ["brightness=", "brightness", "auto_adjust=", "auto_adjust", "show_in_menu=", "show_in_menu", 
#     "refresh_rate=", "refresh_rate", "resolution=", "resolution", "colors=", "colors"]

M = Module.new
M.modspice :core_image => "Hardware Accelerated", :main_display => true, 
:mirror => "off", :online => true,
:track_spices => true
p M.spices_added
# => ["online=", "online", "core_image=", "core_image", "main_display=", "main_display", "mirror=", "mirror"]
p M.class_variables
# => ["@@main_display", "@@spices_added", "@@core_image", "@@mirror", "@@online"]

module Tiempo
  FORMATS = {:short => "%m/%d/%y", :long => "%A, %B %d, %Y"}
  modspice :fecha =>  Proc.new {|time,key| time.strftime(FORMATS[key.to_sym])},
  :ahora => Proc.new {Time.now}
end

p Tiempo.fecha(Time.now,:short)
# => "11/14/10"
p Tiempo.fecha(Time.now,:long)
# => "Sunday, November 14, 2010"
p Tiempo.ahora
# => Sun Nov 14 02:56:19 -0200 2010
module LCD
  modspice :core_image => "Hardware Accelerated", :main_display => true,
  :track_spices => true
  modspice :mirror => "off", :online => true, :track_spices => true
end
p LCD.spices_added
# => ["online=", "online", "core_image=", "core_image", "main_display=", 
#     "main_display", "mirror=", "mirror", "core_image=", "core_image", 
#     "main_display=", "main_display", "online=", "online", "mirror=", "mirror"]